{include file="public/public"}
<style type="text/css">
    #show tr td{
        overflow: hidden;
    }
    #show tr td p {
        width: 150px;
        float: left;
        text-align: center;
    }

</style>
<div class="layui-tab layui-tab-brief" lay-filter="demoTitle">
    <div class="layui-body layui-tab-content site-demo site-demo-body">
        <div class="layui-tab-item layui-show">
            <div class="layui-main">
                <fieldset class="layui-elem-field layui-field-title" style="margin-top: 50px;"></fieldset>
                <span class="layui-breadcrumb">
                    <a href="__APP__/{$menuConfigArry['functionMod']}/{$menuConfigArry['menuLabel']}">{$menuConfigArry['pmenuName']}</a>
                    <a><cite>{$menuConfigArry['menuName']}</cite></a>
                </span>
                <hr>

                <table class="layui-table" lay-skin="line">
                    <thead>
                    <tr>
                        <td width="267">企业名</td>
                        <td width="261">负责人</td>
                        <td width="261">联系电话</td>
                        <td width="261">行业</td>
                        <td width="261">地址</td>
                        <td width="180">操作</td>
                    </tr>
                    </thead>
                    <tbody>
                    <?
	                    if($Arr){
	                      	foreach($Arr as $val){
	                        $tmp = addslashes(json_encode($val));
	                     ?>
                    <tr>
                        <td>{$val[companyName]}</td>
                        <td>{$val[chargerName]}</td>
                        <td>{$val[tel]}</td>
                        <td>{$val[industry]}</td>
                        <td>{$val[address]}</td>
                        <td>
                            <a href="#" class="layui-btn layui-btn-sm" onclick='edit("{$tmp}",2)'>修改 </a>
                        </td>
                    </tr>
                    <?php
                        }
                    }
                ?>
                    </tbody>
                </table>

                <FORM action="__APP__/admin/editCompany" enctype="multipart/form-data" method="post">
                    <div id="show" style="display:none" class="show">
                        <table class="layui-table">
                            <colgroup>
                                <col width="400">
                                <col width="400">
                            </colgroup>
                            <thead>
                            <tr>
                                <td colspan="2">企业信息</td>
                                <input type="hidden" id="id" name="id">
                            </tr>
                            </thead>
                            <tbody>

                            <tr class="ctt_gr">
                                <td align="left" class="leftClass">
                                    <p>公司名称：</p>
                                    <input class="textField_hp1" name="companyName" lay-verify="title" autocomplete="off" class="" id="companyName">
                                </td>
                                <td align="left">
                                    <p>负责人：</p>
                                    <input class="textField_hp1" size="20" id="chargerName" name="chargerName" />
                                </td>
                            </tr>
                            <tr class="ctt_gr">
                                <td align="left">
                                    <p>行业：</p>
                                    <select id="industry" name="industry">
                                        <option value="机构组织">机构组织</option>
                                        <option value="农林牧渔">农林牧渔</option>
                                        <option value="医药卫生">医药卫生</option>
                                        <option value="建筑建材">建筑建材</option>
                                        <option value="冶金矿产">冶金矿产</option>
                                        <option value="信息产业">信息产业</option>
                                        <option value="机械机电">机械机电</option>
                                    </select>
                                </td>
                                <td>
                                    <p>联系电话：</p>
                                    <input class="textField_hp1" size="20" id="tel" name="tel" />
                                </td>
                            </tr>
                            <tr class="ctt_gr">
                                <td align="left">
                                    <p>组织代码：</p>
                                    <input class="textField_hp1" size="20" id="orgCode" name="orgCode" />
                                </td>
                                <td align="left">
                                    <p>邮箱：</p>
                                    <input class="textField_hp1" size="20" id="email" name="email" />
                                </td>
                            </tr>
                            <tr class="ctt_gr">
                                <td align="left">
                                    <p>营业执照：</p>
                                    <input type="hidden" id="demand" name="demand">
                                    <div class="layui-upload">
                                        <button type="button" class="layui-btn" id="test1">上传图片</button>
                                        <div class="layui-upload-list">
                                            <img class="layui-upload-img" id="demo1">
                                            <p id="demoText"></p>
                                        </div>
                                    </div>
                                    <!--<input class="textField_hp1" size="20" id="demand" name="File"  type="file"/>-->
                                </td>

                                <td align="left">
                                    <p>详细地址：</p>
                                    <input class="textField_hp1" size="20" id="address" name="address" />
                                </td>
                            </tr>

                            <tr class="ctt_gr">
                                <td height="31" colspan="2" align="center">
                                    <input name="submit22" type="submit" value="确定" border="0" class="layui-btn" id="ok" />
                                    <input name="submit22" type="button" value="取消" border="0" onclick="document.getElementById('show').style.display='none'" class="layui-btn layui-btn-warm" />
                                </td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                </FORM>
            </div>
        </div>
    </div>
</div>

<script language="javascript">

    function edit(val, flag) {
        var json = JSON.parse(val);
        $("#id").val(json.id);
        $("#chargerName").val(json.chargerName);
        $("#companyName").val(json.companyName);
        $("#industry").val(json.industry);
        $("#address").val(json.address);
        $("#orgCode").val(json.orgCode);

        $("#email").val(json.email);
        $("#tel").val(json.tel);
        $("#show").show();
    }


</script>

